from django.db import models
from django.contrib.auth.models import User


# Create your models here.

class BlogArticles(models.Model):
    author = models.ForeignKey(User, on_delete='CASCADE')
    title = models.CharField(max_length=300)
    content = models.TextField()
    publish = models.DateTimeField(auto_now=True)

    class Meta:
        ordering = ["publish"]

    def __str__(self):
        return self.title



